org.eclipse.vtp.framework.databases.configurations
Class DatabaseQueryConfiguration

java.lang.Object
  extended by org.eclipse.vtp.framework.databases.configurations.DatabaseQueryConfiguration
All Implemented Interfaces:
IConfiguration, DatabaseConstants

public class DatabaseQueryConfiguration
extends java.lang.Object
implements IConfiguration, DatabaseConstants

A configuration for a database query.

Author:
Lonnie Pryor

Field Summary
 
Fields inherited from interface org.eclipse.vtp.framework.databases.configurations.DatabaseConstants
NAME_COLUMN, NAME_COMPARISON, NAME_CRITERIA, NAME_DATABASE, NAME_DRIVER, NAME_JDBC_DATABASE, NAME_JNDI_DATABASE, NAME_MAPPING, NAME_NAME, NAME_PASSWORD, NAME_QUERY, NAME_RESULT_CARDINALITY, NAME_RESULT_LIMIT, NAME_RESULT_NAME, NAME_RESULT_TYPE, NAME_TABLE, NAME_TIMEOUT, NAME_TYPE, NAME_URI, NAME_URL, NAME_USERNAME, NAME_VALUE, NAMESPACE_URI
 
Constructor Summary
DatabaseQueryConfiguration()
          Creates a new DatabaseQueryConfiguration.
 
Method Summary
 void addCriteria(DatabaseCriteriaConfiguration criteria)
          Adds a criteria to this query.
 void addMapping(DatabaseMappingConfiguration mapping)
          Adds a mapping to this query.
 DatabaseCriteriaConfiguration[] getCriteria()
          Returns the criteria specified for the query.
 java.lang.String getDatabase()
          Returns the name of the database to query.
 DatabaseMappingConfiguration[] getMappings()
          Returns the mappings specified to the query.
 int getQueryTimeout()
          Returns the maximum number of seconds to wait for the query.
 int getResultLimit()
          Returns the maximum number of records to return.
 java.lang.String getResultName()
          Returns the name of the result to populate.
 java.lang.String getResultType()
          Returns the name of the type of result to create.
 java.lang.String getTable()
          Returns the name of the table to query.
 boolean isResultArray()
          Returns true if multiple records should be returned.
 void load(org.w3c.dom.Element configurationElement)
          Loads the configuration information from the specified XML element.
 void removeCriteria(DatabaseCriteriaConfiguration criteria)
          Removes a criteria from this query.
 void removeMapping(DatabaseMappingConfiguration mapping)
          Removes a mapping from this query.
 void save(org.w3c.dom.Element configurationElement)
          Saves the configuration information into the supplied XML element.
 void setDatabase(java.lang.String database)
          Sets the name of the database to query.
 void setQueryTimeout(int queryTimeout)
          Sets the maximum number of seconds to wait for the query.
 void setResultArray(boolean resultArray)
          Changes the multiple records setting.
 void setResultLimit(int resultLimit)
          Sets the maximum number of records to return.
 void setResultName(java.lang.String resultName)
          Sets the name of the result to populate.
 void setResultType(java.lang.String resultType)
          Sets the name of the type of result to create.
 void setTable(java.lang.String table)
          Sets the name of the table to query.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DatabaseQueryConfiguration

public DatabaseQueryConfiguration()
Creates a new DatabaseQueryConfiguration.

Method Detail

getDatabase

public java.lang.String getDatabase()
Returns the name of the database to query.

Returns:
The name of the database to query.

setDatabase

public void setDatabase(java.lang.String database)
Sets the name of the database to query.

Parameters:
database - The name of the database to query.

getTable

public java.lang.String getTable()
Returns the name of the table to query.

Returns:
The name of the table to query.

setTable

public void setTable(java.lang.String table)
Sets the name of the table to query.

Parameters:
table - The name of the table to query.

getResultName

public java.lang.String getResultName()
Returns the name of the result to populate.

Returns:
The name of the result to populate.

setResultName

public void setResultName(java.lang.String resultName)
Sets the name of the result to populate.

Parameters:
resultName - The name of the result to populate.

getResultType

public java.lang.String getResultType()
Returns the name of the type of result to create.

Returns:
The name of the type of result to create.

setResultType

public void setResultType(java.lang.String resultType)
Sets the name of the type of result to create.

Parameters:
resultType - The name of the type of result to create.

isResultArray

public boolean isResultArray()
Returns true if multiple records should be returned.

Returns:
True if multiple records should be returned.

setResultArray

public void setResultArray(boolean resultArray)
Changes the multiple records setting.

Parameters:
resultArray - True if multiple records should be returned.

getResultLimit

public int getResultLimit()
Returns the maximum number of records to return.

Returns:
The maximum number of records to return.

setResultLimit

public void setResultLimit(int resultLimit)
Sets the maximum number of records to return.

Parameters:
resultLimit - The maximum number of records to return.

getCriteria

public DatabaseCriteriaConfiguration[] getCriteria()
Returns the criteria specified for the query.

Returns:
The criteria specified for the query.

addCriteria

public void addCriteria(DatabaseCriteriaConfiguration criteria)
Adds a criteria to this query.

Parameters:
criteria - The criteria to add.

removeCriteria

public void removeCriteria(DatabaseCriteriaConfiguration criteria)
Removes a criteria from this query.

Parameters:
criteria - The criteria to remove.

getMappings

public DatabaseMappingConfiguration[] getMappings()
Returns the mappings specified to the query.

Returns:
The mappings specified to the query.

addMapping

public void addMapping(DatabaseMappingConfiguration mapping)
Adds a mapping to this query.

Parameters:
mapping - The mapping to add.

removeMapping

public void removeMapping(DatabaseMappingConfiguration mapping)
Removes a mapping from this query.

Parameters:
mapping - The mapping to remove.

getQueryTimeout

public int getQueryTimeout()
Returns the maximum number of seconds to wait for the query.

Returns:
The maximum number of seconds to wait for the query.

setQueryTimeout

public void setQueryTimeout(int queryTimeout)
Sets the maximum number of seconds to wait for the query.

Parameters:
queryTimeout - The maximum number of seconds to wait for the query.

load

public void load(org.w3c.dom.Element configurationElement)
Description copied from interface: IConfiguration
Loads the configuration information from the specified XML element.

Specified by:
load in interface IConfiguration
Parameters:
configurationElement - The element to load the configuration from.

save

public void save(org.w3c.dom.Element configurationElement)
Description copied from interface: IConfiguration
Saves the configuration information into the supplied XML element.

Specified by:
save in interface IConfiguration
Parameters:
configurationElement - The element to save the configuration to.